#include <stdio.h>

int main ()
{
	int i,n;
	int num;
	int sum1=0,sum2=0,even_num=0,odd_num=0;
	scanf("%d",&n);
	for ( i=0; i<n; i++) {
		scanf("%d",&num);
		if ( num&1 ) {
			odd_num ++;
			sum2 += num;
		} else {
			even_num ++;
			sum1 += num; 
		}	
	}
	
	printf("%d\n%d\n%d\n%d",sum2,odd_num,sum1,even_num);
}
